# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=phpstress
pkgver=5.f987a7e
pkgrel=2
groups=('blackarch' 'blackarch-dos')
pkgdesc='A PHP denial of service / stress test for Web Servers running PHP-FPM or PHP-CGI.'
arch=('any')
url='https://github.com/nightlionsecurity/phpstress'
license=('MIT')
depends=('php')
makedepends=('git')
source=("git+https://github.com/nightlionsecurity/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i '1i\#!/usr/bin/php' "$pkgname.php"
}

package() {
  cd $pkgname

  install -Dm 755 "$pkgname.php" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 license.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

